<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/bootstrap/css/bootstrap-theme.min.css"/>
        <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/bootstrap/css/alertify.core.css">
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/bootstrap/css/alertify.default.css">
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/Css/bootstrap-responsive.css"/>
       	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/bootstrap/css/bootstrap-table.min.css">
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/Css/style.css"/>
    <link href="<%=request.getContextPath()%>/Css/jquery-ui.min.css"
          type="text/css" rel="stylesheet"/>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery-1.11.3.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/bootstrap/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/bootstrap/js/alertify.min.js"></script>
            <script type="text/javascript" src="<%=request.getContextPath()%>/bootstrap/js/bootstrap-table.min.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/bootstrap/js/bootstrap-table-zh-CN.min.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/ckform.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/common.js"></script>
    <script type="text/javascript"
            src="<%=request.getContextPath()%>/js/jquery-ui.min.js"></script>

</head>
<body>
	<div style="margin-top: 5%;padding-left: 30%">
		<input type="button" class="btn btn-primary" onclick="closeCreateRoom()" value="停止创建房间" />
		<input type="button" class="btn btn-primary" onclick="openCreateRoom()" value="开启创建房间" />
	</div>
</body>
<script type="text/javascript">
var sys=sys||{};
sys.context="${basePath}";
alertify.set({
	labels : {
		ok     : "确认",
		cancel : "取消"
	},
	delay : 5000,
	buttonReverse : false,
	buttonFocus   : "ok"
});
	$(function(){
		$('#addClubModal').on('show.bs.modal', function (event) {
			  initAddClub();
			  var button = $(event.relatedTarget); // Button that triggered the modal
			  var managerId = button.data('managerid'),managerName=button.data('managername'); // Extract info from data-* attributes
			  // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
			  // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
			  var modal = $(this);
			  if(managerId && managerName){
				  modal.find('#clubManagerId').val(managerId).prop("disabled",true);
				  modal.find('#clubManagerName').val(managerName).prop("disabled",true);
			  }
			});
		
		$("#manager_from").on("change","#playerId",function(){
			$("#manager_from").find("#playerName").val();
			$("#addManagerBtn").removeData("manager");
		});
	});
	
	function closeCreateRoom(){
		$.post(sys.context+"club/closeCreateRoom.html",{},function(data){
			alertify.alert(data["msg"]);
		},"json");
	}
	function openCreateRoom(){
		$.post(sys.context+"club/openCreateRoom.html",{},function(data){
			alertify.alert(data["msg"]);
		},"json")
	}
</script>


</html>